import type { R, TableDataInfo } from '@/api/model/resultModel';
import type { XhljDataCenterForm, XhljDataCenterQuery, XhljDataCenterVo } from '@/api/xhlj/model/dataCenterModel';
import { request } from '@/utils/request';

// 查询资料中心列表
export function listDataCenter(query?: XhljDataCenterQuery) {
  return request.get<TableDataInfo<XhljDataCenterVo>>({
    url: '/xhlj/dataCenter/list',
    params: query,
  });
}

// 查询资料中心详细
export function getDataCenter(dataCenterId: number) {
  return request.get<R<XhljDataCenterVo>>({
    url: `/xhlj/dataCenter/${dataCenterId}`,
  });
}

// 新增资料中心
export function addDataCenter(data: XhljDataCenterForm) {
  return request.post<R<void>>({
    url: '/xhlj/dataCenter',
    data,
  });
}

// 修改资料中心
export function updateDataCenter(data: XhljDataCenterForm) {
  return request.put<R<void>>({
    url: '/xhlj/dataCenter',
    data,
  });
}

// 删除资料中心
export function delDataCenter(dataCenterIds: number | Array<number>) {
  return request.delete<R<void>>({
    url: `/xhlj/dataCenter/${dataCenterIds}`,
  });
}
